/**
 * 创建于：6/6/16
 * 创建人：杨骐彰
 */
@import "../../../styles/variables";

.sem-datepicker {
  display: inline-block;
  position: relative;
  z-index: 1;
  vertical-align: middle;
  width: 10rem;
  box-sizing: border-box;
  border: solid 1px $color-primary;
  padding: ($form-control-height - 1.375rem) / 2  .5rem;
  padding-right: 1.875rem;
  border-radius: .25rem;
  background-color: #fff;
  font-size: .75rem;
  &.isMini{
    padding: .3125rem;
    width: 11.25rem;
    border-radius: .125rem;
    input{
      color: #434343;
    }
    > img {
      right: .5rem;
      top: .3125rem;
    }
  }
  &.open{
    z-index: 99;
  }
  input {
    height: 1.25rem;
    line-height: 1.25rem;
    outline: none;
    border-radius: .25rem;
    width: 100%;
    padding: 0;
    border: none;
    font-size: 0.875rem;

  }
  > img {
    position: absolute;
    right: .3125rem;
    top: .4375rem;
  }
  .datepicker-drop {
    $width: 13.125rem;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 1rem;
    padding: .625rem;
    width: $width;
    height: 15.625rem;
    border: solid 1px $color-primary;
    background-color: #fff;
    border-radius: 2px;
    //-webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.26);
    //box-shadow: 0 1px 8px rgba(0, 0, 0, 0.26);

    .arrow {
      $size: .625rem;
      position: absolute;
      top: -($size);
      border-bottom: solid $size $color-primary;
      border-left: solid $size transparent;
      border-right: solid $size transparent;

      &:before {
        content: '';
        left: -.625rem;
        position: absolute;
        top: 1px;
        border-bottom: solid $size #fff;
        border-left: solid $size transparent;
        border-right: solid $size transparent;
      }
    }
    .datepicker-drop-view {
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      padding: .625rem;
    }

    .weekend {
      > span {
        width: $width / 7;
        display: inline-block;
        text-align: center;
        padding: .4375rem 0;
        cursor: default;
        font-weight: bold;
      }
    }

    %item {
      cursor: default;
      > span {
        &:hover {
          background-color: $border-color;
        }
      }

      &.active > span {
        background-color: $color-primary;
        color: #fff;
      }
    }

    .day-item {
      width: $width / 7;
      display: inline-block;
      text-align: center;
      height: 1.875rem;
      @extend %item;

      > span {
        height: 1.5rem;
        width: 1.5rem;
        line-height: 1.5rem;
        margin-top: .4375rem;
        display: inline-block;
        border-radius: 2px;
      }

      &.fade {
        color: #ccc;
      }
    }

    .month-item, .year-item {
      width: $width / 3;
      font-size: .875rem;
      display: inline-block;
      text-align: center;
      height: 3.125rem;
      @extend %item;

      > span {
        display: inline-block;
        height: 2.5rem;
        line-height: 2.5rem;
        width: 3.75rem;
        border-radius: .25rem;
        margin-top: .3125rem;
      }
    }

    .switcher {
      font-size: 1rem;
      text-align: center;
      padding-bottom: .625rem;
      > span {
        display: inline-block;
        border-radius: 2px;
        padding: 0 .1875rem;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
        &:hover {
          background-color: $border-color;
        }
      }

      .show-value {
        margin: 0 7px;
      }
    }
  }


  .datepicker-drop-mini {
    $width: 11.1875rem;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 1rem;
    padding: .625rem;
    width: $width;
    height: 13.75rem;
    border: solid 1px $color-primary;
    background-color: #fff;
    border-radius: 2px;
    //-webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.26);
    //box-shadow: 0 1px 8px rgba(0, 0, 0, 0.26);

    .arrow {
      $size: .625rem;
      position: absolute;
      top: -($size);
      border-bottom: solid $size $color-primary;
      border-left: solid $size transparent;
      border-right: solid $size transparent;
      &:before {
        content: '';
        position: absolute;
        left: -.625rem;
        top: .0625rem;
        border-bottom: solid $size #fff;
        border-left: solid $size transparent;
        border-right: solid $size transparent;
      }
    }
    .datepicker-drop-view {
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      padding: .625rem;
    }

    .weekend {
      > span {
        width: 1.325rem;
        display: inline-block;
        text-align: center;
        cursor: default;
        font-weight: bold;
      }
    }

    %item {
      cursor: default;
      > span {
        &:hover {
          background-color: $border-color;
        }
      }

      &.active > span {
        background-color: $color-primary;
        color: #fff;
      }
    }

    .day-item {
      width: 1.325rem;
      display: inline-block;
      text-align: center;
      height: 1.5rem;
      @extend %item;

      > span {
        height: 1.25rem;
        width: 1.325rem;
        line-height: 1.25rem;
        margin-top: .25rem;
        display: inline-block;
        border-radius: 2px;
      }

      &.fade {
        color: #ccc;
      }
    }

    .month-item, .year-item {
      width: 3.25rem;
      font-size: .875rem;
      display: inline-block;
      text-align: center;
      height: 2.5rem;
      @extend %item;

      > span {
        display: inline-block;
        height: 2rem;
        line-height: 2rem;
        width: 3.25rem;
        border-radius: .25rem;
        margin-top: .3125rem;
      }
    }

    .switcher {
      font-size: 1rem;
      text-align: center;
      padding-bottom: .625rem;
      > span {
        display: inline-block;
        border-radius: .125rem;
        padding: 0 .1875rem;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
        &:hover {
          background-color: $border-color;
        }
      }



      .show-value {
        margin: 0 .4375rem;
      }
    }
  }


}
